package com.dengs.controller;

import com.dengs.UserFeignClient;
import com.dengs.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

@Controller
public class MovieController {
    @Autowired
    private UserFeignClient feignClient;

    @GetMapping("/user/{id}")
    @ResponseBody
    public User findById(@PathVariable long id){
        return this.feignClient.findById(id);
    }
}
